<html>
<head><meta charset="utf-8"><title>projection cache and subobligations #77325 · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/projection.20cache.20and.20subobligations.20.2377325.html">projection cache and subobligations #77325</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="241147624"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/projection%20cache%20and%20subobligations%20%2377325/near/241147624" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/projection.20cache.20and.20subobligations.20.2377325.html#241147624">(Jun 02 2021 at 13:23)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="125294">@Aaron Hill</span> -- let's talk about the projection cache, and subobligations, here. There is a pending PR from <span class="user-mention" data-user-id="117366">@Tatsuyuki Ishi</span> that I owe some feedback to for quite some time regardless (<a href="https://github.com/rust-lang/rust/pull/77325">https://github.com/rust-lang/rust/pull/77325</a>)</p>



<a name="241313065"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/projection%20cache%20and%20subobligations%20%2377325/near/241313065" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/projection.20cache.20and.20subobligations.20.2377325.html#241313065">(Jun 02 2021 at 20:10)</a>:</h4>
<p>From an incr comp perspective, there are two conflicting goals here</p>



<a name="241313112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/projection%20cache%20and%20subobligations%20%2377325/near/241313112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/projection.20cache.20and.20subobligations.20.2377325.html#241313112">(Jun 02 2021 at 20:11)</a>:</h4>
<p>One one hand, we would like to cache things as aggressively as possible, so that we can avoid re-evaluating or re-projecting as much as possible</p>



<a name="241313307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/projection%20cache%20and%20subobligations%20%2377325/near/241313307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/projection.20cache.20and.20subobligations.20.2377325.html#241313307">(Jun 02 2021 at 20:13)</a>:</h4>
<p>On the other hand, we need to make sure that we consistently produce <code>EvaluatedToOk</code> or <code>EvaluatedToOkModuloRegions</code> regardless of the state of the cache, so that re-running a subset of our evaluations for incr-comp produces the same result</p>



<a name="241313479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/projection%20cache%20and%20subobligations%20%2377325/near/241313479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/projection.20cache.20and.20subobligations.20.2377325.html#241313479">(Jun 02 2021 at 20:14)</a>:</h4>
<p>To accomplish the second goal, we need to know if sub-obligations may end up producing <code>EvaluatesToOkModuloRegions</code> at any depth, since that needs to consistently propagate back up to the parent</p>



<a name="242656441"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/projection%20cache%20and%20subobligations%20%2377325/near/242656441" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/projection.20cache.20and.20subobligations.20.2377325.html#242656441">(Jun 14 2021 at 20:42)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> Do you want to schedule a time to talk about this? AFAIK, this is the last remaining unstable fingerprints issue (aside from a minor one involving trait selection overflow).</p>



<a name="243026062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/projection%20cache%20and%20subobligations%20%2377325/near/243026062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/projection.20cache.20and.20subobligations.20.2377325.html#243026062">(Jun 17 2021 at 14:30)</a>:</h4>
<p>Cc <span class="user-mention" data-user-id="119031">@Esteban Küber</span> - I made a initial attempt to fix this in <a href="https://github.com/rust-lang/rust/pull/85868">https://github.com/rust-lang/rust/pull/85868</a>. It fixes the ICE, but the performance is awful</p>



<a name="243028329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/projection%20cache%20and%20subobligations%20%2377325/near/243028329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/projection.20cache.20and.20subobligations.20.2377325.html#243028329">(Jun 17 2021 at 14:44)</a>:</h4>
<p><span class="user-mention" data-user-id="125294">@Aaron Hill</span> I do</p>



<a name="243028335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/projection%20cache%20and%20subobligations%20%2377325/near/243028335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/projection.20cache.20and.20subobligations.20.2377325.html#243028335">(Jun 17 2021 at 14:44)</a>:</h4>
<p>(want to schedule time)</p>



<a name="243028356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/projection%20cache%20and%20subobligations%20%2377325/near/243028356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/projection.20cache.20and.20subobligations.20.2377325.html#243028356">(Jun 17 2021 at 14:44)</a>:</h4>
<p>can I send you an email?</p>



<a name="243031603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/projection%20cache%20and%20subobligations%20%2377325/near/243031603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/projection.20cache.20and.20subobligations.20.2377325.html#243031603">(Jun 17 2021 at 15:04)</a>:</h4>
<p><span class="user-mention" data-user-id="125294">@Aaron Hill</span> I'll take a look it tomorrow. I'll at a hospital all day today and didn't bring my laptop.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>